class Solution
{
public:
    int numberOfPoints(vector<vector<int>> &nums)
    {
        unordered_set<int> s;
        for (auto &interval : nums)
        {
            for (int i = interval[0]; i <= interval[1]; i++)
            {
                s.insert(i);
            }
        }
        return s.size();
    }
};